
package io.zhifei.modules.sys.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.zhifei.common.utils.PageUtils;
import io.zhifei.common.utils.Query;
import io.zhifei.modules.sys.system.dao.SysLogDao;
import io.zhifei.modules.sys.system.entity.SysLogEntity;
import io.zhifei.modules.sys.system.service.SysLogService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("sysLogService")
public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLogEntity> implements SysLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String startTime = params.get("startTime").toString();
        String endTime = params.get("endTime").toString();
        String name = params.get("name").toString();
        Integer page = Integer.valueOf(params.get("page").toString());
        Integer pageSize = Integer.valueOf(params.get("pageSize").toString());

        Page pageParams = new Page(page, pageSize);
        Page<SysLogEntity> pageResult = this.baseMapper.getLogList(pageParams, startTime, endTime, name);
        return new PageUtils(pageResult);
    }
}
